public class Fibonacci implements IGenerator {
	protected int last1=0, last2=0;
	protected boolean first = true;
	
	public int next() {
		if (last1==0) {
			if (first) {
				first = false;
				return last1;
			}
			else {
				last1 = 1;
				return last1;
			}
		}
		else {
			int ret = last1+last2;
			last2 = last1;
			last1 = ret;
			return ret;
		}
	}
}

